<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="${request.contextPath}/"/>
    <meta charset="UTF-8">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimum-scale=1.0">
    <title>漠河智慧社区</title>
    <link href="Content/wechat/css/reset.css" rel="stylesheet" type="text/css">
    <!--签到-->
    <link href="Content/wechat/css/woDeXinYuan_FB.css" rel="stylesheet" type="text/css">

    <script src="Content/wechat/js/jquery.min.js"></script>
    <!--字体缩放-->
    <script src="Content/wechat/js/ziti.js"></script>
    <!--end 字体缩放-->
    <!--上传图片js-->
    <script  src="Content/wechat/js/svg.js"></script>
    <!--end 上传图片js-->
</head>
<body>
<header >
    <img src="Content/wechat/images/mdtj.jpg">
</header>
<div class="xinyuan">
    <form id="wenda" action="/wechat/home/lawmanage/mdtj/saveForm" method="post">
    <div class="xinyuan_box">
        <dl class="clearfix">
            <dt>姓名</dt>
            <dd>
                <input  name="name" class="text" type="text" placeholder="请输入愿望标题">
            </dd>
        </dl>
        <dl class="clearfix">
            <dt>联系方式</dt>
            <dd>
                <input  name="phone" class="text" type="text" placeholder="请输入电话">
            </dd>
        </dl>
        <dl class="clearfix">
            <dt>所在辖区</dt>
            <dd>
                <select id="shequ" name="communityid">
                <option>---请选择---</option>
                <option>北京</option>
                <option >上海</option><!--设置默认选中项-->
                <option>广州</option>
                <option>深圳</option>
            </select>
            </dd>
        </dl>
        <dl class="clearfix">
            <dt>单位</dt>
            <dd>
                <input  name="unit" class="text" type="text" placeholder="请输入愿望标题">
            </dd>
        </dl>
        <dl class="clearfix">
            <dt>身份证号</dt>
            <dd>
                <input  name="numberid" class="text" type="text" placeholder="请输入愿望标题">
            </dd>
        </dl>
        <h4>详细信息：</h4>
        <textarea  name="content" class="textarea"  placeholder="请简要说明"></textarea>

        <!--上传多张图片-->


    </div>
    <div class="button_shangChuan">确定</div>
    </form>
</div>


</body>
<script>
    window.onload = function () {
        findDemoList();

    }

    function findDemoList() {
        $.ajax({
            url: "/wechat/home/life/zwdt/findShequList",
            type: 'post',
            dataType: 'json',
            success: function (result) {
                //ajaxCallBack(result);
                console.log(result.data);
                var insetViewData = ""; //视图数据
                $.each(result.data, function (index, items) {
                    insetViewData += " <option value=\"" + items.id + "\">" + items.communityname + "</option>";

                });
                $("#shequ").html(insetViewData);

            }

        })
    }



    $(".button_shangChuan").on("click", function () {
        $.ajax({
            type: "POST",   //提交的方法
            url: "/wechat/home/lawmanage/mdtj/saveForm", //提交的地址
            data: $('#wenda').serialize(),// 序列化表单值
            async: false,
            error: function (data) {  //失败的话
                alert(data.info);
            },
            success: function (data) {  //成功
                console.log(data)
                alert(data.info);  //就将返回的数据显示出来
                window.location.reload();
            }
        });
    });

</script>
</html>
